<?php

/**
 * Acreedor form base class.
 *
 * @package    form
 * @subpackage acreedor
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseAcreedorForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'rut_acreedor'     => new sfWidgetFormInput(),
      'nombres'          => new sfWidgetFormInput(),
      'apellido_paterno' => new sfWidgetFormInput(),
      'apellido_materno' => new sfWidgetFormInput(),
      'giro'             => new sfWidgetFormInput(),
      'direccion'        => new sfWidgetFormTextarea(),
      'comuna'           => new sfWidgetFormInput(),
      'ciudad'           => new sfWidgetFormInput(),
      'region'           => new sfWidgetFormInput(),
      'telefono'         => new sfWidgetFormInput(),
      'fax'              => new sfWidgetFormInput(),
      'email'            => new sfWidgetFormInput(),
      'rep_legal'        => new sfWidgetFormInput(),
      'rut_rep_legal'    => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'Acreedor', 'column' => 'id', 'required' => false)),
      'rut_acreedor'     => new sfValidatorString(array('max_length' => 12)),
      'nombres'          => new sfValidatorString(array('max_length' => 50)),
      'apellido_paterno' => new sfValidatorString(array('max_length' => 25)),
      'apellido_materno' => new sfValidatorString(array('max_length' => 25)),
      'giro'             => new sfValidatorString(array('max_length' => 25)),
      'direccion'        => new sfValidatorString(),
      'comuna'           => new sfValidatorString(array('max_length' => 25)),
      'ciudad'           => new sfValidatorString(array('max_length' => 25)),
      'region'           => new sfValidatorString(array('max_length' => 25)),
      'telefono'         => new sfValidatorString(array('max_length' => 25)),
      'fax'              => new sfValidatorString(array('max_length' => 25)),
      'email'            => new sfValidatorString(array('max_length' => 50)),
      'rep_legal'        => new sfValidatorString(array('max_length' => 70)),
      'rut_rep_legal'    => new sfValidatorString(array('max_length' => 12)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Acreedor', 'column' => array('rut_acreedor')))
    );

    $this->widgetSchema->setNameFormat('acreedor[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Acreedor';
  }


}
